#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    for (int i = 1;i <= n; i++){
        int s;
        cin >> s;
        bool f = false;
        for (int x = 1; x * x <= s && f == false; x++){
            for (int y = 1; y * y <= s && f == false; y++){
                if (x * x + y * y == s){
                    f = true;
                    cout << "Yes" << endl;
                }
            }
        }
        if (f == false) cout << "No" << endl;
    }
    return 0;
}